﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


namespace dbPoll_Application.Models
{
    public class Message
    {
        public virtual int messageID { get; set; }
        public virtual String message { get; set; }
        public virtual IList<User> recipients { get; set; }
        public virtual DateTime timeSent { get; set; }

        public Message()
        {
            this.messageID = -1;
            this.message = String.Empty;
            this.recipients = null;
            this.timeSent = DateTime.Now;
        }

        public Message(String message)
        {
            this.messageID = -1;
            this.message = message;
            this.recipients = new List<User>();
            this.timeSent = DateTime.Now;
        }

        public Message(String message, User recipient)
        {
            this.messageID = -1;
            this.message = message;
            this.recipients = new List<User>();
            this.recipients.Add(recipient);
            this.timeSent = DateTime.Now;
        }

        public Message(String message, IList<User> recipients)
        {
            this.messageID = -1;
            this.message = message;
            this.recipients = recipients;
            this.timeSent = DateTime.Now;
        }

        public Message(int messageID, String message, IList<User> recipients, DateTime timeSent)
        {
            this.messageID = messageID;
            this.message = message;
            this.recipients = recipients;
            this.timeSent = timeSent;
        }
    }
}
